#include <iostream>
using namespace std;
class WageStrategy
{
public:
    virtual double getWage( ) = 0;
    virtual ~WageStrategy() {}
protected:
    double wage;
};

class CommonWage:public WageStrategy  //普通员工工资
{
public:
    CommonWage(double bw):base_wage(bw)
    {}
    double getWage( )
    {
        wage=base_wage;
        return wage;
    }
protected:
    double base_wage;
};

class SalesWage:public WageStrategy   //销售员工资
{
public:
    SalesWage(double bw,double s,double r):base_wage(bw),sales(s),rate(r)
    {

    }
    double getWage( )
    {
        wage=sales*rate+base_wage;
        return wage;
    }
protected:
    double base_wage,sales,rate;
};

class ManagerWage:public WageStrategy    //销售部门经理工资
{
public:
    ManagerWage(double bw,double s,double r,double p):base_wage(bw),sales(s),rate(r),prize(p)
    {

    }
    double getWage( )
    {
        wage=sales*rate+base_wage;
        return wage;
    }
protected:
    double base_wage,sales,rate,prize;
};
int  main()
{
    WageStrategy *p[3];
    p[0]=new ManagerWage(5000,90000,0.05,800);
    p[1]=new SalesWage(1000,9500,0.1);
    p[2]=new CommonWage(6500);
    for(int i=0; i<3; i++)
        cout<<p[i]->getWage()<<endl;
    return  0;
}
